package com.wyj.wuliwuli.controller;

import com.wyj.wuliwuli.common.AjaxRequest;
import com.wyj.wuliwuli.common.AjaxResult;
import com.wyj.wuliwuli.common.PageParam;
import com.wyj.wuliwuli.entity.WuliVideo;
import com.wyj.wuliwuli.entity.WuliVideoCommentDetail;
import com.wyj.wuliwuli.service.WuliVideoCommentDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Api(tags = "评论详情")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/wuli-video-comment-detail")
public class WuliVideoCommentDetailController {

    private final WuliVideoCommentDetailService wuliVideoCommentDetailService;



    @ApiOperation(value = "根据评论抬头id查询所有明细")
    @GetMapping("/details")
    public AjaxResult details(@ApiParam(name = "commentId", value = "评论ID") Long commentId) {
        return wuliVideoCommentDetailService.details(commentId);
    }

    @ApiOperation(value = "保存")
    @PostMapping("/save")
    public AjaxResult save(@RequestBody AjaxRequest<WuliVideoCommentDetail> ajaxRequest) {
        return wuliVideoCommentDetailService.save(ajaxRequest);
    }

    @ApiOperation(value = "根据id删除")
    @DeleteMapping("/{id}")
    public AjaxResult delete(@PathVariable Long id) {
        return wuliVideoCommentDetailService.deleteById(id);
    }



}
